<?php
	@header("Content-Type:text/html;charset=utf-8");
	// @header("Access-Control-Allow-Origin:*");
	
	
	$conn =  mysql_connect("localhost","root","root");   
	$a = mysql_select_db("object",$conn);   //连接数据库
	
	
	$ways= $_GET["ways"];
	$pwd = $_GET["pwd"];
	
	$sql = "select * from userinfo where user_name = '$ways' or user_email = '$ways' or user_phone = '$ways'";
//	echo $sql;
	mysql_query("set charset set utf-8");     //数据库输入输出编码格式
	
	$result = mysql_query($sql); 
	
	$item = mysql_fetch_object($result);
//	echo $row;
	$msg = array();
	if($item&&$item->user_pwd==$pwd){
		$msg["status"] = true;
		$msg["msg"] = "登陆成功";
		$msg["user_id"] = $item->user_id;
		$msg["user_name"] = $item->user_name;
	}else{
		$msg["status"] = false;
		$msg["msg"] = "登陆失败";
	}
	echo json_encode($msg);
?>